<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    
    <title>My JSP 'login.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
	<script src="../js/jquery-1.6.js" type="text/javascript" ></script>
	<script src="../js/jquery.form.js" type="text/javascript"></script>
	<script src="../js/json2.js" type="text/javascript"></script>
	<script language="javascript" type="text/javascript">
	$(document).ready(function(){
		//登录
		$("#loginbtn").click(function(){
			var options = { 
				url: "Login.action", 
				dataType: 'json', 
				success: function(data) {				 
					if(data!="undefined"&&data!=null)
					{
						if(data.state=="1")
						{
							window.location="../index.jsp";
						}
						else
						{
							window.location="../error.jsp";
						}
					}
			   }				
			}; 			
			$("#loginform").ajaxSubmit(options);
        });

		
	});
	</script>
  </head>
  
  <body> 
   <form id="loginform" name="loginform" action="Login.action" method="post">
   		username<input type="text" id="name" name="user.name"/><br/>
   		password<input type="text" id="password" name="user.password"/><br/>
   		<input type="button" id="loginbtn" value="login">
   </form>
  </body>
</html>
